<?php
class StackTest extends PHPUnit_Framework_TestCase
{

    public function testArray()
    {
        $stack = array();
        $this->assertEquals(0, count($stack));

        array_push($stack, 'foo');
        $this->assertEquals('foo', $stack[count($stack)-1]);
        $this->assertEquals(1, count($stack));

        $this->assertEquals('foo', array_pop($stack));
        $this->assertEquals(0, count($stack));
    }

    /**
     * @test
     */
    public function Stringlen()
    {
        $str = 'abc看看';
        $this->assertEquals(9,  strlen($str));
    }

    public function testadd(){
        $this->assertEquals(4, add(1, 3));
    }
}

function add($a,$b){
    return $a + $b;
}